C#视频录制
//弹出框,命名文件名
FmFileName form = new FmFileName();
form.Owner = this;
form.ShowDialog();
string ad = DateTime.Now.TimeOfDay.ToString("hhmmss") "";
if (string.IsNullOrEmpty(fileName))
{
fileName = DateTime.Now.ToString("yyyyMMdd") "-" DateTime .Now .TimeOfDay.ToString ("hhmmss") ".avi";
}
else
{
fileName = ".avi";
} camera = new Camera();
var date = DateTime.Now.ToString("yyyy-MM-dd");
//有名字,就不用这个了
camera.LogFileName = "log1.txt";//log文件
camera.LogFilePath = string.Format(@"d:\\Camera\\{0}\\Log\\", date);//日志和录像保存d盘camera文件里
camera.StartRecording(picbox_Video, string.Format(@"d:\\Camera\\{0}\\Video\\", date),fileName);
评论